-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Jira - improvements #18859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Jira - improvements #18859
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughMultiple Jira components received metadata and UI text refinements (docs → documentation, punctuation, capitalization) and version bumps. Functional edits include adding a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action as Add/Update Comment Action
participant Validator as Input Validator
participant Converter as atlassianDocumentFormat
participant Jira as Jira API
User->>Action: Submit props (issueIdOrKey, body?, comment?)
Action->>Validator: Ensure body OR comment present
alt neither provided
Validator-->>Action: throw ConfigurationError
Action-->>User: Error
else comment provided (no body)
Action->>Converter: Convert comment -> Atlassian Document Format
Converter-->>Action: document format
Action->>Jira: POST/PUT with converted body
else body provided
Action->>Jira: POST/PUT with body as-is
end
Jira-->>Action: Success response
Action-->>User: Success summary
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
components/jira/jira.app.mjs (2)
635-659: Pagination termination bug in getResourcesStreamChecking nextResources.length on an object always returns undefined, causing early termination after first page. Use the filtered items length.
while (true) { const nextResources = await resourceFn({ @@ page += 1; - const filteredResource = resourceFiltererFn(nextResources); - for (const resource of filteredResource) { + const items = resourceFiltererFn(nextResources) || []; + for (const resource of items) { yield resource; } - if (!nextResources.length) { - return; - } + // Stop if this page returned fewer than pageSize items + if (items.length < pageSize) return; }
167-170: Fix typo in jqlFilter descriptionMinor typo.
- description: "This is required for webhok creation", + description: "This is required for webhook creation",
🧹 Nitpick comments (5)
components/jira/actions/get-task/get-task.mjs (1)
41-41: Summary message now less informative but more robust.The summary changed from displaying the task title (
response.title) to echoing back the input task ID. While this makes the code more defensive against unexpected response structures, users no longer see the descriptive task title in the output.This is acceptable as a defensive coding practice, though consider whether the response actually contains useful metadata (like status or description) that could enhance the summary without introducing fragility.
components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs (3)
27-35: Validate page-size cap vs API limits.UI allows maxResults up to 5000, while per-page clamp is 1000. Some Jira search endpoints cap at 100. If the backend caps at 100, oversized page requests waste retries or error.
- Confirm the actual cap for the underlying API call used by jira.searchIssues. If it’s 100, adjust getMaxResultsPerPage() accordingly.
- getMaxResultsPerPage() { - return Math.min(this.maxResults, 1000); - }, + // If API cap is 100, reduce to 100; otherwise keep 1000. + getMaxResultsPerPage() { + const API_PAGE_CAP = 100; // set to 1000 if supported by the wrapper + return Math.min(this.maxResults, API_PAGE_CAP); + },Also applies to: 99-101
36-42: Consider safer default for fields.Defaulting to "*all" can bloat payloads and slow searches. Consider "*navigable" or a minimal default like "key,issuetype,summary,status".
91-96: Props alignment: failFast vs validateQuery.JQL search typically exposes validateQuery (strict/warn/none). Please confirm failFast is a valid param for this call. If not, consider replacing or adding validateQuery.
failFast: { type: "boolean", label: "Fail Fast", description: "Fail this request early if we can't retrieve all field data", optional: true, }, + // Optional: add validateQuery if supported by the wrapper/API + // validateQuery: { + // type: "string", + // label: "Validate Query", + // description: "Controls JQL validation (e.g., 'strict', 'warn', 'none')", + // optional: true, + // options: ["strict", "warn", "none"], + // },And pass it through in params if available.
Also applies to: 146-171
components/jira/jira.app.mjs (1)
317-354: Make commentId options more robust and user-friendly
- Add expand=renderedBody so we can fall back to readable text.
- Build label defensively from ADF or rendered HTML.
async options({ prevContext, issueIdOrKey, cloudId, }) { @@ let { startAt } = prevContext || {}; const pageSize = 50; try { const resp = await this.listIssueComments({ issueIdOrKey, cloudId, params: { startAt, maxResults: pageSize, + expand: "renderedBody", }, }); @@ return { - options: resp?.comments?.map((comment) => ({ - value: comment.id, - label: comment.body?.content[0]?.content[0]?.text || comment.id, - })), + options: resp?.comments?.map((comment) => { + // Try ADF -> flatten first paragraph text; else strip HTML from renderedBody; else fallback to id + const adfText = Array.isArray(comment.body?.content) + ? comment.body.content + .flatMap((blk) => Array.isArray(blk?.content) ? blk.content : []) + .map((n) => n?.text) + .filter(Boolean) + .join(" ") + : ""; + const rendered = typeof comment.renderedBody === "string" + ? comment.renderedBody.replace(/<[^>]+>/g, "") + : ""; + const label = (adfText || rendered || "").trim().slice(0, 80) || comment.id; + return { value: comment.id, label }; + }), context: { startAt, }, };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (27)
components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs(1 hunks)components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs(3 hunks)components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs(1 hunks)components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs(1 hunks)components/jira/actions/assign-issue/assign-issue.mjs(1 hunks)components/jira/actions/common/issue.mjs(1 hunks)components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs(1 hunks)components/jira/actions/create-issue/create-issue.mjs(2 hunks)components/jira/actions/create-version/create-version.mjs(2 hunks)components/jira/actions/delete-project/delete-project.mjs(2 hunks)components/jira/actions/get-all-projects/get-all-projects.mjs(3 hunks)components/jira/actions/get-issue/get-issue.mjs(3 hunks)components/jira/actions/get-task/get-task.mjs(3 hunks)components/jira/actions/get-transitions/get-transitions.mjs(2 hunks)components/jira/actions/get-user/get-user.mjs(1 hunks)components/jira/actions/get-users/get-users.mjs(1 hunks)components/jira/actions/list-issue-comments/list-issue-comments.mjs(2 hunks)components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs(1 hunks)components/jira/actions/transition-issue/transition-issue.mjs(2 hunks)components/jira/actions/update-comment/update-comment.mjs(5 hunks)components/jira/actions/update-issue/update-issue.mjs(2 hunks)components/jira/jira.app.mjs(7 hunks)components/jira/package.json(1 hunks)components/jira/sources/events/events.mjs(2 hunks)components/jira/sources/issue-created/issue-created.mjs(1 hunks)components/jira/sources/issue-deleted/issue-deleted.mjs(1 hunks)components/jira/sources/issue-updated/issue-updated.mjs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs (1)
components/jira/actions/update-comment/update-comment.mjs (2)
visibility(100-100)body(94-98)
components/jira/actions/update-comment/update-comment.mjs (1)
components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs (1)
body(79-81)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Publish TypeScript components
- GitHub Check: Ensure component commits modify component versions
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (33)
components/jira/sources/issue-deleted/issue-deleted.mjs (1)
7-7: Version bump as part of metadata updates.The version increment is consistent with the PR's broader pattern of updating Jira component metadata. No behavioral changes detected.
components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs (1)
8-9: LGTM: Minor metadata improvements.The description wording change from "docs" to "documentation" improves consistency, and the patch version bump is appropriate for documentation-only changes.
components/jira/actions/create-custom-field-options-context/create-custom-field-options-context.mjs (1)
7-8: URL verified. Metadata refinements are appropriate.The Jira API documentation link returns HTTP 200, confirming the endpoint is accessible and correctly referenced. The description text refinement and version bump are appropriate for this metadata-only change.
components/jira/sources/issue-updated/issue-updated.mjs (1)
7-7: Clarify the reason for the version bump.This file only shows a version increment with no accompanying code, metadata, or behavioral changes. Since the PR objectives focus on fixing the
jira-add-comment-to-issueaction and this file is an unrelated event source, it's unclear why this version bump is necessary.Please confirm whether this version bump is intentional and explain what changes justify it, or consider reverting it if no actual modifications were made to this component.
components/jira/package.json (1)
3-3: LGTM! Appropriate version bump.The patch version increment aligns with the metadata and documentation improvements across the Jira components.
components/jira/sources/issue-created/issue-created.mjs (1)
7-7: LGTM! Version bump is appropriate.The version increment is consistent with the metadata updates across the PR.
components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs (1)
6-6: LGTM! Metadata improvements are appropriate.The version bump and documentation link text update improve consistency across Jira actions.
Also applies to: 12-12
components/jira/actions/assign-issue/assign-issue.mjs (1)
6-6: LGTM! Consistent metadata improvements.The version increment and documentation reference update align with the standardization pattern across the PR.
Also applies to: 12-12
components/jira/sources/events/events.mjs (1)
7-8: LGTM! Good metadata improvements.The version bump and documentation reference are consistent with the PR pattern. The
eventsprop description improvement on Line 17 provides clearer guidance to users.Also applies to: 17-17
components/jira/actions/get-user/get-user.mjs (1)
6-7: LGTM! Metadata and grammar improvements.The version bump, documentation reference update, and punctuation correction enhance consistency across Jira actions.
components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs (1)
8-9: LGTM! Consistent metadata updates.The version bump and documentation reference improvement align with the standardization effort across the PR.
components/jira/actions/get-all-projects/get-all-projects.mjs (1)
6-7: LGTM! Good metadata and UI improvements.The changes enhance user experience through:
- Consistent documentation references
- More descriptive label on Line 24 ("Recent Projects" vs "Recent")
- Grammar correction on Line 33 ("added or updated" vs "add or update")
Also applies to: 24-24, 33-33
components/jira/actions/update-issue/update-issue.mjs (1)
10-11: LGTM! Metadata improvements enhance consistency.The updates to documentation links, version bump, and description punctuation cleanup improve the action's metadata consistency across the codebase.
Also applies to: 88-88
components/jira/actions/create-issue/create-issue.mjs (1)
9-10: LGTM! Consistent metadata and UI improvements.The documentation link update, version bump, and Title Case label capitalization align with best practices for UI presentation.
Also applies to: 21-22
components/jira/actions/get-issue/get-issue.mjs (1)
6-7: LGTM! Metadata consistency improvements.The updates standardize documentation references, bump the version appropriately, and apply Title Case to labels for better UI consistency.
Also applies to: 39-39, 52-53
components/jira/actions/delete-project/delete-project.mjs (1)
6-7: LGTM! Consistent documentation and UI improvements.The metadata updates maintain consistency with the broader set of Jira action improvements in this PR.
Also applies to: 33-34
components/jira/actions/transition-issue/transition-issue.mjs (1)
7-8: LGTM! Comprehensive metadata standardization.The updates improve documentation consistency and UI presentation across multiple props, maintaining alignment with the broader Jira action improvements in this PR.
Also applies to: 52-52, 57-58, 64-64, 69-70
components/jira/actions/get-task/get-task.mjs (2)
6-7: LGTM!Documentation wording improvement and version increment are appropriate.
23-30: No action required — verification confirms implementation is correct.The
issueIdOrKeypropDefinition properly supports thetasksOnlyparameter and correctly filters for task IDs. WhentasksOnly: true, the JQL query specifically filters forissuetype = "Task", ensuring only valid task identifiers are returned. The implementation handles both issues and tasks appropriately through its query logic.components/jira/actions/get-transitions/get-transitions.mjs (3)
6-7: LGTM: Version bump and documentation update.The version increment and documentation link update are appropriate maintenance changes.
43-60: LGTM: UI improvements for consistency.The label capitalization changes improve visual consistency and enhance the user experience in the UI.
61-67: No issues found.The "expand" propDefinition exists in jira.app.mjs and is correctly referenced. The custom description override appropriately provides context-specific guidance for the transitions action.
components/jira/actions/create-version/create-version.mjs (4)
5-7: LGTM! Metadata improvements for consistency.The name capitalization, documentation link phrasing, and version bump are appropriate cosmetic improvements that enhance consistency across the codebase.
33-65: LGTM! Prop label and description improvements.The label capitalizations (e.g., "Version Name", "Start Date", "Release Date") and description adjustments (removing unnecessary notes, trailing periods) improve consistency and clarity. The removal of "Required when creating a version." from the name prop description is appropriate since the required status is implicit.
1-85: Confirm scope: File unrelated to PR's primary objective.This file modifies the
create-versionaction, which doesn't directly address the PR's stated objective of fixing thejira-add-comment-to-issueaction (issue #18840). While the AI summary mentions "Multiple Jira action components receive metadata updates," please confirm:
- Are these changes intentionally bundled to improve consistency across all Jira actions?
- Should these broader refactoring changes be in a separate PR to maintain focused, reviewable changes?
69-81: Confirm intentionality of parameter removal and align version bump strategy.The
releasedandmoveUnfixedIssuesToparameters are valid Jira API fields for version creation. The current code does not expose these as props or include them in the data payload tocreateVersion().If these parameters were previously exposed to users in version 0.1.13 or earlier, their removal in 0.1.14 is a breaking change and requires a major version bump (not minor). If they were never exposed as user-facing props, then there is no breaking change concern.
Please clarify:
- Were
releasedandmoveUnfixedIssuesToexposed as configurable props in any prior version?- If yes, why were they removed and should this be a major version bump?
- If no, can you confirm the AI summary that claimed they were "removed" was inaccurate?
components/jira/actions/search-issues-with-jql/search-issues-with-jql.mjs (2)
7-7: Version bump looks good.No functional changes in this file; bump to 0.1.2 is fine and consistent with a doc/metadata update.
102-118: Confirm pagination contract with jira.app.mjs (nextPageToken/isLast).This assumes jira.searchIssues returns nextPageToken and isLast. Jira’s JQL search often uses startAt/maxResults. If jira.app.mjs doesn’t normalize to token pagination, this loop could stall or under-fetch.
- Please confirm jira.app.mjs searchIssues returns { issues, nextPageToken, isLast } for this endpoint.
- If not, we should switch to startAt pagination. I can draft that update quickly if needed.
Also applies to: 140-141
components/jira/actions/list-issue-comments/list-issue-comments.mjs (1)
6-7: LGTM on metadata polishDescription wording and "Order By" label alignment look good. Version bump consistent.
Also applies to: 33-34
components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs (1)
34-39: Good UX: comment prop + clear validationAdding a plain-text comment prop and requiring one of comment/body resolves the original confusion.
Also applies to: 74-76
components/jira/actions/common/issue.mjs (1)
16-16: LGTM on copy editsDescriptions read better and are consistent with other actions.
Also applies to: 24-25, 29-30
components/jira/actions/update-comment/update-comment.mjs (2)
35-43: PropDefinition for commentId is correctWires cloudId and issueIdOrKey for scoped options. Good.
90-92: Validation is appropriateGuarding that either comment or body is present is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/jira/jira.app.mjs (1)
89-90: Consider using "the issue" instead of "an issue" for consistency.The genericized description addresses the past review comment, but the suggested wording was "The ID or key of the issue" rather than "an issue."
Apply this diff for exact alignment with the previous suggestion:
- description: "The ID or key of an issue", + description: "The ID or key of the issue",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/jira/actions/get-users/get-users.mjs(1 hunks)components/jira/jira.app.mjs(8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- components/jira/actions/get-users/get-users.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (4)
components/jira/jira.app.mjs (4)
59-59: LGTM!Documentation improvement adds proper closing parenthesis.
124-124: LGTM!Consistent label capitalization and removal of trailing periods improves documentation uniformity.
Also applies to: 157-157, 174-174, 225-225, 275-275
317-354: LGTM!The
commentIdpropDefinition is well-implemented with:
- Proper pagination support
- Early return when
issueIdOrKeyis missing- Error handling via try-catch
- Appropriate fallback to
comment.idwhen the ADF structure differsThis addresses the PR objectives by providing a new prop for comment-related actions.
92-102: Clarify: tasksOnly parameter is not currently used by any component.The parameter was added to the
issueIdOrKeypropDefinition (line 92) and the conditional JQL logic is correct. However, no code in the codebase currently passestasksOnly: truewhen using this property—it exists but is unused. Confirm whether this is intentional preparatory code or if the implementation is incomplete and needs to be wired into consuming components.
Resolves #18840
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores